<template>
  <view class="home">
    <up-cell-group :border="false" customStyle="background:#fff">
      <up-cell title="隐私政策" :clickable="false" isLink @click="$u.route('/pages/index/agreement?type=4')"> </up-cell>
      <up-cell title="用户协议" :clickable="false" isLink @click="$u.route('/pages/index/agreement?type=3')"> </up-cell>
      <up-cell title="关于我们" :border="false" :clickable="false" isLink
        @click="$u.route('/pages/index/agreement?type=2')"> </up-cell>
    </up-cell-group>
  </view>
  <view class=" action-bar">
    <up-button plain text="注销账号" color="#F87610" shape="circle"></up-button>
    <up-button text="退出登录" color="#F87610" customStyle="marginTop:20rpx" @click="_logout" shape="circle"></up-button>
  </view>
</template>

<script setup>
  import { logout } from '../../config/api';
  const _logout = () => {
    uni.showModal({
      content: '确定退出登陆吗',
      success: (res) => {
        if (res.confirm) {
          uni.removeStorageSync('userInfo')
          uni.removeStorageSync('token')
          uni.$chat.logout()
          uni.$u.route({
            url: '/pages/index/index',
            type: 'switchTab'
          })
        }
      }
    })
  }
</script>

<style scoped lang="scss">
  .home {
    background: #fff;
    min-height: 100vh;
  }

  .action-bar {
    position: fixed;
    left: 30rpx;
    right: 30rpx;
    bottom: env(safe-area-inset-bottom);
  }
</style>